<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>can: xcan_intr_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">can
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xcan__intr__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xcan_intr_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>Contains an example of how to use the <a class="el" href="struct_x_can.html" title="The XCan driver instance data. ">XCan</a> driver directly. </p>
<p>The example here shows using the driver/device in interrupt mode.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>This code assumes that Xilinx interrupt controller (XIntc) is used in the system to forward the CAN device interrupt output to the processor and no operating system is being used.</p>
<p>The Baud Rate Prescaler Register (BRPR) and Bit Timing Register (BTR) are setup such that CAN baud rate equals 40Kbps, assuming that the the CAN clock is 24MHz. The user needs to modify these values based on the desired baud rate and the CAN clock frequency. For more information see the CAN 2.0A, CAN 2.0B, ISO 11898-1 specifications.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who       Date     Changes
</p>
<hr/>
<p>
1.00a xd/sv     01/12/09 First release
2.00a ktn       10/22/09 Updated to use the HAL APIs/macros.
                 The macros have been renamed to remove _m from the
                 name.
2.00a bss       01/11/11 Updated the example to be used with the SCUGIC in
                 Zynq.
2.00a bss       01/16/12 Updated the example to fix CR 694533,
                 replaced INTC_DEVID with INTC_DEVICE_ID.
3.2   ms  01/23/17 Added xil_printf statement in main function to
                   ensure that "Successfully ran" and "Failed" strings are
                   available in all examples. This is a fix for CR-965028.
3.3   ask  08/01/18 Fixed Cppcheck and GCC warnings in can driver
3.7   ht   07/04/23 Added support for system device-tree flow.
3.8   ht   12/13/23 Added support for ECC.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan__intr__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the main function of the Can interrupt example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the main function of the Can interrupt example. </p>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_can.html#ad1b7e8246d4595ef6bde028a562c08fa">XCan::EnableECC</a>, <a class="el" href="group__can.html#ga8402ffb273c0d8a8e72f2a845d96b269">TEST_MESSAGE_ID</a>, <a class="el" href="group__can.html#ga2389175edaafb057e5a5cf089f6cdec1">XCan_CreateDlcValue</a>, <a class="el" href="group__can.html#ga874d1b170d939f5ab18bf88fbad00b43">XCan_CreateIdValue</a>, <a class="el" href="group__can.html#ga994a0b0bd9c938e99de9d7ffceb10ef3">XCan_EnterMode()</a>, <a class="el" href="group__can.html#gaba97ed0970710fa7b2da922f836fdea7">XCAN_ESR_ACKER_MASK</a>, <a class="el" href="group__can.html#gaa82168a0c9d1ce36e4ec4310fdf2fcfd">XCAN_ESR_BERR_MASK</a>, <a class="el" href="group__can.html#ga630be69fc280301a8856ed8ccb1c5866">XCAN_ESR_CRCER_MASK</a>, <a class="el" href="group__can.html#ga71466ab85c99729cb8c88657fedcdfd3">XCAN_ESR_FMER_MASK</a>, <a class="el" href="group__can.html#ga118328341a73c8b0d602c3f38b9eb587">XCAN_ESR_STER_MASK</a>, <a class="el" href="group__can.html#ga6b437133a6a2f40f56cf3c80102f5b0d">XCan_GetMode()</a>, <a class="el" href="group__can.html#ga95c42c89b517eab2aa63b584178e19d7">XCAN_HANDLER_ERROR</a>, <a class="el" href="group__can.html#ga2b8a36e69531ded498ee4aae48144703">XCAN_HANDLER_EVENT</a>, <a class="el" href="group__can.html#gac3819485b065f3726f30fab00768891a">XCAN_HANDLER_RECV</a>, <a class="el" href="group__can.html#ga0951d27e2a23e485fb9d04019714ff19">XCAN_HANDLER_SEND</a>, <a class="el" href="group__can.html#gacbd9f5e256dcbd948afe916d13bc7b35">XCan_Initialize()</a>, <a class="el" href="group__can.html#ga1abd3a018094fd4d586599d708c33e4f">XCan_InterruptEnable()</a>, <a class="el" href="group__can.html#gaafc4a0e025e8e3eb800778eba5a00c66">XCan_IntrHandler()</a>, <a class="el" href="group__can.html#ga16bf9b91c18418196abe8271eed806ce">XCan_IsTxFifoFull</a>, <a class="el" href="group__can.html#ga553b29006c0052225803342e61f63918">XCAN_IXR_ALL</a>, <a class="el" href="group__can.html#ga519a0e1365d4237932311c794a9f3286">XCAN_IXR_ARBLST_MASK</a>, <a class="el" href="group__can.html#ga43b89eddb5c487830ab99f876eaf5a34">XCAN_IXR_BSOFF_MASK</a>, <a class="el" href="group__can.html#gab3ff6f454fae07e0b637ad85e2564b72">XCAN_IXR_ECC_MASK</a>, <a class="el" href="group__can.html#ga269318cb287c11f639cf185dce640191">XCAN_IXR_RXOFLW_MASK</a>, <a class="el" href="group__can.html#ga054d2d002f9141d9d937d262f5b637de">XCAN_IXR_RXUFLW_MASK</a>, <a class="el" href="group__can.html#ga5fce703c1f3a145620255809ecf422bb">XCAN_IXR_SLP_MASK</a>, <a class="el" href="group__can.html#gaccb86502df2129af8cbddd4da45db912">XCAN_IXR_TXBFLL_MASK</a>, <a class="el" href="group__can.html#ga3436502be0f71ac99a60299c73b86f1f">XCAN_IXR_TXFLL_MASK</a>, <a class="el" href="group__can.html#gaea1b2f81446269b8b30267bf840b3c31">XCAN_IXR_WKUP_MASK</a>, <a class="el" href="group__can.html#ga5ea4b468a9ac5d22eb5411cff7a59353">XCan_LookupConfig()</a>, <a class="el" href="group__can.html#gac2ff2f17841fcf789f5e214205aa844a">XCAN_MODE_CONFIG</a>, <a class="el" href="group__can.html#gad11c39965154f3eeb280a07fdfcc38bc">XCAN_MODE_LOOPBACK</a>, <a class="el" href="group__can.html#ga1d8ac17789423c440872ffd4585b8c3c">XCan_Recv()</a>, <a class="el" href="group__can.html#ga6c52fb4d4b12d62e3e713ad182f00d8b">XCan_Reset()</a>, <a class="el" href="group__can.html#gaa18e848a6ffc670e024972ffc71b2ba8">XCan_SelfTest()</a>, <a class="el" href="group__can.html#gad4717011f46b8e9d5e15c0bfb04c33c8">XCan_Send()</a>, <a class="el" href="group__can.html#ga75aabbb82d96151cadfd3c26a2a285e9">XCan_SetBaudRatePrescaler()</a>, <a class="el" href="group__can.html#gaf60120410396727f6e9304ce9ba65980">XCan_SetBitTiming()</a>, and <a class="el" href="group__can.html#ga3a7838a033b61a842b06e3ee4b06a614">XCan_SetHandler()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
